package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.MonitorBlockHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SentinelController {
//    @GetMapping("/sentinel/hello")
//    public String hello(){
//        return "hello sentinel";
//    }
    @GetMapping(value =  "/sentinel/hello")
    @SentinelResource(value = "helloResource",blockHandler = "helloBlockHandler",blockHandlerClass = MonitorBlockHandler.class)
    public String hello(){
        return "hello sentinel";
    }
}
